from django.conf.urls import url
from administrator.views import index,users,goodstype,goods

urlpatterns = [
    url(r'^$', index.index,name = "admin_index"),
    #会员信息路由管理
    url(r'^users$', users.index,name = "admin_users_index"), 
    url(r'^users/add$', users.add,name = "admin_users_add"),    
    url(r'^users/insert$', users.insert,name = "admin_users_insert"),    
    url(r'^users/del/(?P<uid>[0-9]+)$', users.delete,name = "admin_users_del"),    
    url(r'^users/edit/(?P<uid>[0-9]+)$', users.edit,name = "admin_users_edit"),    
    url(r'^users/update/(?P<uid>[0-9]+)$', users.update,name = "admin_users_update"),    

    url(r'^users/password/(?P<uid>[0-9]+)$', users.password,name = "admin_users_passwd"),
    url(r'^users/password/change$', users.changepasswd,name = "admin_password_change"),    
    
    #登录路由
    url(r'^login$', index.login, name="admin_login"),
    url(r'^dologin$', index.dologin, name="admin_dologin"),
    url(r'^logout$', index.logout, name="admin_logout"),
    url(r'^verify$', index.verify, name="admin_verify"), #验证码
    # 后台商品类别信息管理
    url(r'^goodstype$', goodstype.index, name="admin_type_index"),
    url(r'^goodstype/add/(?P<tid>[0-9]+)$', goodstype.add, name="admin_type_add"),
    url(r'^goodstype/insert$', goodstype.insert, name="admin_type_insert"),
    url(r'^goodstype/del/(?P<tid>[0-9]+)$', goodstype.delete, name="admin_type_del"),
    url(r'^goodstype/edit/(?P<tid>[0-9]+)$', goodstype.edit, name="admin_type_edit"),
    url(r'^goodstype/update/(?P<tid>[0-9]+)$', goodstype.update, name="admin_type_update"),
    # 后台商品信息管理
    url(r'^goods/(?P<pIndex>[0-9]+)$', goods.index, name="admin_goods_index"),
    url(r'^goods/add$', goods.add, name="admin_goods_add"),
    url(r'^goods/insert$', goods.insert, name="admin_goods_insert"),
    url(r'^goods/del/(?P<gid>[0-9]+)$', goods.delete, name="admin_goods_del"),
    url(r'^goods/edit/(?P<gid>[0-9]+)$', goods.edit, name="admin_goods_edit"),
    url(r'^goods/update/(?P<gid>[0-9]+)$', goods.update, name="admin_goods_update"),
]
